grammar ExprSyntax;
import ExprLexer;


@header {
package com.xrui.parser2;
}


expression
    :  functionCall
     | expression op=(AND|OR) expression
     |  '(' expression ')'
    ;

functionCall
   : (MAX | MIN | GROUPBY) '(' functionArgs ')'
    | COUNT '(' (starArg='*' |  functionArg?) ')'
    | TEST '(' ( functionArgs?) ')'
    ;

functionArg
    :  field_name
    ;
functionArgs
    : field_name (',' field_name)*

    ;